

export default class QueryVariable {

    private static dict: { [key: string]: string };

    public static getValue(key: string): string {
        if (!this.dict) {
            this.dict = {};
            let query = window.location.search.substring(1);
            let vars = query.split("&");
            for (var i = 0; i < vars.length; i++) {
                var pair = vars[i].split("=");
                this.dict[pair[0]] = pair[1];
            }
            console.log(`[query] ${query}`);
        }
        return this.dict[key];
    }
}